<?php

function downfile($field, $value) {
    extract(unserialize($this->fields[$field]['setting']));
    $list_str = array();
    if ($value) {
        $value_arr = explode('|', $value);
        $fileurl = $value_arr['0'];
        if ($fileurl) {
            $sel_server = $value_arr['1'] ? explode(',', $value_arr['1']) : '';
            //镜像服务器缓存
            $server_list = array();
            if (is_array($server_list)) {
                foreach ($server_list as $_k => $_v) {
                    if ($value && is_array($sel_server) && in_array($_k, $sel_server)) {
                        $downloadurl = $_v['siteurl'] . $fileurl;
                        $list_str[] = "<a href='{$downloadurl}' target='_blank'>{$_v['sitename']}</a>";
                    }
                }
            }
            return $list_str;
        }
    }
}

?>